/**
* 功能描述: 指标输入demo
* @author 崔孝楠
* @date 2022/9/29 9:02
* @version 1.0
*/
<template>
  <div style="width: 500px">
    <!-- 单位后置 -->
    <span class="yw-measure-input-group-wrapper" style="margin-bottom: 10px" >
    <span class="yw-measure-input-group" >
      <input class="yw-input" placeholder="ywTextInput" />
      <span class="yw-measure-input-group-addon">￥</span>
    </span>
  </span>
    <!-- 单位后缀 -->
    <span class="yw-measure-input-affix-wrapper" id="yw-measure-input-affix-wrapper" style="margin-bottom: 10px" >
    <input class="yw-input" placeholder="ywTextInput"
           @focus="addFocused('yw-measure-input-affix-wrapper')"
           @blur="removeFocused('yw-measure-input-affix-wrapper')"  />
    <span class="yw-measure-input-suffix">
      <!-- 后缀 -->
      ￥
    </span>
  </span>
  </div>
</template>

<script>
export default {
  name: "index",
  methods: {
    /**
     * 添加选中时样式
     */
    addFocused(id) {
      let inputNumberDiv = document.getElementById(id)
      inputNumberDiv.classList.add('yw-measure-input-affix-wrapper-focused')
    },
    /**
     * 移除选中时样式
     */
    removeFocused(id) {
      let inputNumberDiv = document.getElementById(id)
      inputNumberDiv.classList.remove('yw-measure-input-affix-wrapper-focused')
    }
  }
}
</script>

<style scoped>

</style>
